package com.car.dal.dao.demand;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgDemand;
import com.car.dal.object.TgPartjob;
import com.car.util.Page;

public class TgDemandDaoImpl extends IbatisCommonDao<TgDemand, Long> implements TgDemandDao {

	public GridObj GetList(TgDemand demand, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("asc");
		order.setSort("id");
		// TODO Auto-generated method stub
		return super.findByPage(demand, pageObj, order);
	}
	
	public Integer getDemandCountByType(TgDemand demand) {
		return this.queryForInteger("getDemandCountByType", demand);
	}
	
	public List<TgDemand> getDemandByType(TgDemand demand,Page page) {
		demand.setFirstrownum(page.getFirstrownum());
		demand.setPagesize(page.getPagesize());
		return this.queryForEntityList(TgDemand.class,"getDemandByType", demand);
	}
	
}
